---
title: Chat
description: Learn how to generate chat completions using the Vercel AI SDK in your Next.js Pages Router application
---

# Chat

So far you've learned how to generate text and structured data using single prompts. In this section, you will learn to use `messages` to add a sequence of messages to the language model and generate the response based on the context of the conversation – called chat completion.

<IndexCards
  cards={[
    {
      title: 'Generate Chat Completions',
      description: 'Learn how to generate a chat completion.',
      href: '/examples/next-pages/chat/generate-chat-completion',
    },
    {
      title: 'Stream Chat Completions',
      description: 'Learn how to stream a chat completion.',
      href: '/examples/next-pages/chat/stream-chat-completion',
    },
    {
      title: 'Add Image Inputs',
      description: 'Learn how to add image inputs to a chat completion.',
      href: '/examples/next-pages/chat/use-chat-image-input',
    },
  ]}
/>
